//
//  sendFirCirBgImage.m
//  tcpoctest
//
//  Created by apple on 13-5-3.
//  Copyright (c) 2013年 gump. All rights reserved.
//

#import "sendFirCirBgImage.h"

@implementation sendFirCirBgImage

-(void)SendFCBgImage:(UIImage *)image
{
    //发送 74char(1),25char(1)，背景图长度int,背景图char(x)
    if (![self CheckLogin]) {
        return;
    }
    
    NSData *imageData = UIImageJPEGRepresentation(image, JPG_COMPRESS_RATE);
    
    if ([imageData length] == 0) {
        return;
    }
    
    int l = CHAR_PL * 2 + INT_PL * 2 + [imageData length];
    
    [self initDataByLength:l];
    
    [sb WriteInt:[imageData length] withNTT:NTT_SMALL2BIG];
    [sb WriteData:(char *)[imageData bytes] withLength:[imageData length]];
    
    [self Package];
}

@end
